package outoforder.leetcode01;

import outoforder.leetcode.TreeNode;

/**
 * @author shhjiang_001
 * @create 2020-07-09 16:53
 */
public class Solution700 {
    public TreeNode searchBST(TreeNode root, int val) {
        if (root == null) return null;
        if (root.val == val ) return root;
        if (root.val > val){
                return searchBST(root.left,val);
        }else {
                return searchBST(root.right,val);
        }
    }
}
